const maptreedata = function(data: []) {
  let rsNodes = [];
  data.forEach(element => {
    let item = {};
    item['key'] = element['id'];
    item['title'] = element['name'];
    if(element['childs'] && (element['childs'] as []).length > 0){
      item['expanded'] = true;
      item['children'] = maptreedata(element['childs']);
    }else{
      item['isLeaf'] = true;
    }
    rsNodes.push(item);
  });
  return rsNodes;
}

export {
  maptreedata
}
